#define _CRT_SECURE_NO_WARNINGS 1
#include"listnode.h"

void test1()
{
	SLTNode* plist = NULL;
	SLTPushFront(&plist, 0);
	SLTPushFront(&plist, 1);
	SLTPushFront(&plist, 2);
	SLTPushFront(&plist, 3);
	SLTPrint(plist);
	SLTPushBack(&plist, -1);
	SLTPrint(plist);
}
void test2()
{
	SLTNode* plist = NULL;
	SLTPushBack(&plist, -1);
	SLTPushBack(&plist, 0);
	SLTPushBack(&plist, 1);
	SLTPrint(plist);
	SLTPopBack(&plist);
	SLTPopBack(&plist);
	SLTPopBack(&plist);
	SLTPrint(plist);
}
void test3()
{
	SLTNode* plist = NULL;
	SLTPushBack(&plist, -1);
	SLTPushBack(&plist, 0);
	SLTPushBack(&plist, 1);
	SLTPrint(plist);
	SLTPopFront(&plist);
	SLTPopFront(&plist);
	SLTPopFront(&plist);
	SLTPrint(plist);
}
void test4()
{
	SLTNode* plist = NULL;
	SLTPushBack(&plist, 1);
	SLTPushBack(&plist, 2);
	SLTPushBack(&plist, 3);
	SLTPushBack(&plist, 4);
	SLTPrint(plist);
	SLTNode* pos = SLTFind(plist, 3);
	pos->data = 30;
	SLInsert(&plist, pos, 20);
	SLTPrint(plist);
	SLInsertAfter(pos, 40);
	SLTPrint(plist);
	SLEraseAfter(pos);
	SLTPrint(plist);
	SLTDestroy(plist);
}
int main()
{
	test4();
	return 0;
}